/**
 * 
 */
package com.neal.web.controller;

import java.util.Date;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.neal.web.exception.UserNotNullException;


/**
 * @author Neal
 * @version 1.0
 * @description 
 */
@Controller
@RequestMapping("/exception")
public class ExceptionController {
	
	@RequestMapping("ex1")
	public String testException1(String userId,Model model) throws Exception{
		if(userId.equals("1")){
			throw new UserNotNullException(ExceptionController.class.getName(), new Date(), "error1");
		}
		if(userId.equals("2")){
			throw new UserNotNullException(ExceptionController.class.getName(), new Date(), "error2");
		}
		if(userId.equals("3")){
			throw new RuntimeException("runtime Exception");
		}
		return "user";
	}
}
